package com.apobates.jforum2.troll.notices.biz.impl.api;

import com.apobates.jforum2.threads.stub.vo.ThreadsVo;
import com.apobates.jforum2.troll.forum.stub.vo.BoardVo;
import com.apobates.jforum2.troll.notices.LetterFeignClientConfig;
import com.apobates.jforum2.troll.replies.stub.vo.ReplyVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 消息内部服务客户端
 * @author xiaofanku
 * @since 20211004
 */
@Component
@FeignClient(value="TROLL-GATEWAY", configuration = LetterFeignClientConfig.class)
@RequestMapping("/")
public interface LetterFeignServiceApi {
    //2:指定的版块
    @GetMapping("/board/{id}")
    ResponseEntity<BoardVo> getBoardById(@PathVariable("id")long boardId);

    //1:查看指定的话题
    @GetMapping("/topic/{id}")
    ResponseEntity<ThreadsVo> getTopicById(@PathVariable("id") long topicId);

    //4:查看指定回复
    @GetMapping("/posts/{id}")
    ResponseEntity<ReplyVo> getPostsById(@PathVariable("id")long postsId);
}
